<?php
namespace App\Http\Controllers\desktop\publics;

use App\Models\Feedback;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Redirect;

class FeedbackController extends BaseController {
	
	public function store() {
// 		$member = Auth::user();
// 		if(is_null($member)) {
// 			return redirect('/login');
// 		}
		$bookId = Input::get('book_id');
		$sectionId = Input::get('section_id');
		$content = Input::get('content');
		$data = [
			'member_id' => '5a1672b59a8920042e584333',
			'book_id' => $bookId,
			'section_id' => $sectionId,
			'content' => $content,
			'status' => Feedback::STATUS_PENDING
		];
		Feedback::create($data);
		Session::flash('msg', '提交成功，感谢您的反馈！');
		
		return Redirect::back();
	}
}
